package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.ulwx.tool.DbUtils;

import feeinterface.modeldb.ChannelOpenServiceType;

public class ChannelOpenServiceTypeDao {

	private static final Logger log = Logger.getLogger(ChannelOpenServiceTypeDao.class);
	
	public static List<ChannelOpenServiceType> getBy(Integer serviceTypeCode) throws Exception {
		String sql = "select * from ChannelOpenServiceType a," +
		" Channel b, ServiceCo c where a.ChannelID=b.ChannelSno and" +
		" a.ServiceClassCode=c.ServiceClassCode and " +
		"ServiceClassCode=? and b.Enable=1 and c.Enable=1";
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		map.put(1, serviceTypeCode);
		List<ChannelOpenServiceType> list =
			DbUtils.doQueryClass(null, ChannelOpenServiceType.class, sql, map);
		return list;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
